Optimal. Leaf size=185 \[ -\frac{\left (-A \left (n^2-n+2\right )+2 i B n\right ) (a+i a \tan (c+d x))^n \text{Hypergeometric2F1}(1,n,n+1,1+i \tan (c+d x))}{2 d n}-\frac{(A-i B) (a+i a \tan (c+d x))^n \text{Hypergeometric2F1}\left (1,n,n+1,\frac{1}{2} (1+i \tan (c+d x))\right )}{2 d n}-\frac{(2 B+i A n) \cot (c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.582882, antiderivative size = 185, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.176, Rules used = {3598, 3600, 3481, 68, 3599, 65} \[ -\frac{\left (-A \left (n^2-n+2\right )+2 i B n\right ) (a+i a \tan (c+d x))^n \, _2F_1(1,n;n+1;i \tan (c+d x)+1)}{2 d n}-\frac{(A-i B) (a+i a \tan (c+d x))^n \, _2F_1\left (1,n;n+1;\frac{1}{2} (i \tan (c+d x)+1)\right )}{2 d n}-\frac{(2 B+i A n) \cot (c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3598
Rule 3600
Rule 3481
Rule 68
Rule 3599
Rule 65
Rubi steps
\begin{align*} \int \cot ^3(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d}+\frac{\int \cot ^2(c+d x) (a+i a \tan (c+d x))^n (a (2 B+i A n)-a A (2-n) \tan (c+d x)) \, dx}{2 a}\\ &=-\frac{(2 B+i A n) \cot (c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d}+\frac{\int \cot (c+d x) (a+i a \tan (c+d x))^n \left (a^2 \left (2 i B n-A \left (2-n+n^2\right )\right )-a^2 (1-n) (2 B+i A n) \tan (c+d x)\right ) \, dx}{2 a^2}\\ &=-\frac{(2 B+i A n) \cot (c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d}+(-i A-B) \int (a+i a \tan (c+d x))^n \, dx+\frac{\left (2 i B n-A \left (2-n+n^2\right )\right ) \int \cot (c+d x) (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^n \, dx}{2 a}\\ &=-\frac{(2 B+i A n) \cot (c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{(a (A-i B)) \operatorname{Subst}\left (\int \frac{(a+x)^{-1+n}}{a-x} \, dx,x,i a \tan (c+d x)\right )}{d}+\frac{\left (a \left (2 i B n-A \left (2-n+n^2\right )\right )\right ) \operatorname{Subst}\left (\int \frac{(a+i a x)^{-1+n}}{x} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac{(2 B+i A n) \cot (c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{A \cot ^2(c+d x) (a+i a \tan (c+d x))^n}{2 d}-\frac{(A-i B) \, _2F_1\left (1,n;1+n;\frac{1}{2} (1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^n}{2 d n}-\frac{\left (2 i B n-A \left (2-n+n^2\right )\right ) \, _2F_1(1,n;1+n;1+i \tan (c+d x)) (a+i a \tan (c+d x))^n}{2 d n}\\ \end{align*}
Mathematica [F] time = 64.7095, size = 0, normalized size = 0. \[ \int \cot ^3(c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.942, size = 0, normalized size = 0. \begin{align*} \int \left ( \cot \left ( dx+c \right ) \right ) ^{3} \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{n} \left ( A+B\tan \left ( dx+c \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left ({\left (-i \, A - B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} +{\left (-3 i \, A - B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} +{\left (-3 i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, A + B\right )} \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{e^{\left (6 i \, d x + 6 i \, c\right )} - 3 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, e^{\left (2 i \, d x + 2 i \, c\right )} - 1}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]